<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
    <style type="text/css">
       .inputPassword{
          height:20px;
		  width:198px;
		  vertical-align:middle;
		  line-height:20px;
		  border:#cbcbcb solid 1px;
       }
    </style>
	<script type="text/javascript">
	 $(document).ready(function(){
		 //增加隔行变色效果
   	    $(".listtable").zebra();
		//加载用户角色
		$('#framework_modify_roleid').combobox({
			url:'${pageContext.request.contextPath}/systemManagerAction!loadComboxData.action',  
			valueField:'roleid',
			textField:'rolename',
	 	 	editable:false 	
		});
		//设置默认用户角色
		var roleid='${pSystemManager.roleid}';
		$('#framework_modify_roleid').combobox('setValue',roleid);
		//加载所有部门数据
		 $('#framework_modify_deptId').combotree({
			url:'${pageContext.request.contextPath}/systemManagerAction!getEtlDepartmentData.action?status=1',
			parentField : 'pid',
 			lines : true,
 			required: true,
 			onSelect:function(data){
 				if(data.id!="parent"){
 					$("#framework_modify_deptId").val(data.id);
 				}else{
 					$('#framework_modify_deptId').combotree('clear');
 				}
 				
 			}
	 	 });
		//设置默认用户部门
		var deptId='${pSystemManager.deptId}';
		 $('#framework_modify_deptId').combotree("setValue",deptId);
	 });
	 //切换用户性别        男：1;女：2
     function changeBoyOrGirlRadio(idx){
    	 if(idx==1){
    		 $("#framework_modify_boy").attr("checked",true);
    		 $("#framework_modify_girl").attr("checked",false);
    	 }else{
    		 $("#framework_modify_boy").attr("checked",false);
    		 $("#framework_modify_girl").attr("checked",true);
    	 }
     }
     function validateData(){
		 var userpwd=$("#framework_modify_userpwd").val();
		 var confirmuserpwd=$("#framework_modify_confim_userpwd").val();
		 if(confirmuserpwd=="" || confirmuserpwd.length<0){
			 $.messager.alert("操作提示","确认密码不允许为空！");
			 return;
		 }
		 if(userpwd!=confirmuserpwd){
			 $.messager.alert("操作提示","两次密码不匹配");
			 return;
		 }else{
			 return true;
		 }
	 }
	</script>
    <!-- 修改用户 -->
  <form id="framework_modify_user_modify_form" method="post">
     <table border="0" cellpadding="0" cellspacing="0" height="100%"  width="100%" class="listtable">
        <tr>
			<td height="40px" style="text-align:right" nowrap="nowrap"><span style="color:red;font-size:15px">*</span>账号：&nbsp;</td>
			<td height="28px;">
			    <input id="framework_modify_userid" type="hidden" name="userid" value="${pSystemManager.userid}" />
			    ${pSystemManager.userid}
			</td>
			<td height="40px" style="text-align:right" nowrap="nowrap"><span style="color:red;font-size:15px">*</span>姓名：&nbsp;</td>
			<td height="28px;">
				<input id="framework_modify_username" type="text" name="username" value="${pSystemManager.username}" class="easyui-validatebox" data-options="required:true,missingMessage:'用户名称必须填写'"/>
			</td>
		</tr>
		<tr>
			<td height="40px" style="text-align:right" nowrap="nowrap"><span style="color:red;font-size:15px">*</span>手机号码：&nbsp;</td>
			<td height="40px">
				<input id="framework_modify_phonenum" type="text" name="phonenum"  value="${pSystemManager.phonenum}" class="easyui-numberbox" validType='mobile("framework_modify_phonenum")' data-options="required:true,missingMessage:'只能输入数字'"/>
			</td>
			<td height="40px" style="text-align:right" nowrap="nowrap"><span style="color:red;font-size:15px">*</span>角色：&nbsp;</td>
			<td height="40px">
				<input id="framework_modify_roleid" type="text" name="roleid"     panelHeight="auto" style="width:160px" />
			</td>
		</tr>
		<tr>
			<td height="40px" style="text-align:right" nowrap="nowrap"><span style="color:red;font-size:15px">*</span>密码：&nbsp;</td>
			<td height="40px">
				<input id="framework_modify_userpwd" type="password" name="userpwd" class="easyui-validatebox" data-options="required:true,missingMessage:'用户密码必须填写'"/>
			</td>
			<td height="40px" style="text-align:right" nowrap="nowrap"><span style="color:red;font-size:15px">*</span>确认密码：&nbsp;</td>
			<td height="40px" style="text-align:left;">
				<input id="framework_modify_confim_userpwd" type="password" name="confirmuserpwd" class="easyui-validatebox" data-options="required:true,missingMessage:'用户密码必须填写'"/>
			</td>
		</tr>
		<tr>
			<td height="40px" style="text-align:right" nowrap="nowrap"><span style="color:red;font-size:15px">*</span>部门：&nbsp;</td>
			<td height="40px">
				<input id="framework_modify_deptId" type="text" name="deptId"  data-options="required:true,missingMessage:'用户部门不能为空'"/>
			</td>
			<td height="40px" style="text-align:right" nowrap="nowrap"><span style="color:red;font-size:15px">*</span>电子邮箱：&nbsp;</td>
			<td height="40px">
				<input id="framework_modify_email" type="text" name="email"   value="${pSystemManager.email}"  class="easyui-validatebox" data-options="required:true,validType:'email'"/>
			</td>
		</tr>
		<tr>
		    <td height="40px" style="text-align:right" nowrap="nowrap"><span style="color:red;font-size:15px">*</span>性别：&nbsp;</td>
			<td height="40px" colspan="3">
			     <c:choose>
				     <c:when test="${pSystemManager.sex==1}">
				         <input id="framework_modify_boy"  type="radio" name="framework_modify_boy"   style="margin-left:20px;"  value="1" checked="checked"  onclick="changeBoyOrGirlRadio(1)"/>男
			             <input id="framework_modify_girl" type="radio" name="framework_modify_girl"  style="margin-left:20px" value="2"  onclick="changeBoyOrGirlRadio(2)"/> 女
				     </c:when>
				     <c:otherwise>
						 <input id="framework_modify_boy"  type="radio" name="framework_modify_boy"   style="margin-left:20px;"  value="1"   onclick="changeBoyOrGirlRadio(1)"/>男
			             <input id="framework_modify_girl" type="radio" name="framework_modify_girl"  style="margin-left:20px" value="2" checked="checked" onclick="changeBoyOrGirlRadio(2)"/> 女
				     </c:otherwise>
				</c:choose>
			</td>
		</tr>
		<tr>
			<td height="40px" style="text-align:right" nowrap="nowrap">自我简介：&nbsp;</td>
			<td height="68px" colspan="3">
				<textarea id="framework_modify_userdetailinfo" name="userdetailinfo" class="easyui-validatebox" data-options="required:false,validType:'length[0,60]'" style="width:450px;height:60px;">${pSystemManager.userdetailinfo}</textarea>
			</td>
		</tr>
		<tr>
			<td height="40px" style="text-align:right" nowrap="nowrap">个性签名：&nbsp;</td>
			<td height="68px" colspan="3">
				<textarea id="framework_signatureinfo" name="signatureinfo" class="easyui-validatebox" data-options="required:false,validType:'length[0,60]'" style="width:450px;height:60px;">${pSystemManager.signatureinfo}</textarea>
			</td>
		</tr>
     </table>
   </form>